<template>
    <div class="register-container">
        <div style="width: 400px; margin: 80px auto; position: absolute; left: 35%;">
            <div style="color: black; font-size: 40px; text-align: center; padding: 30px 0">注 册</div>
            <el-form ref="form" :model="form" :rules="rules" size="large">
                <el-form-item prop="identity">
                    <div style="display: flex; align-items: center; color: grey; font-size: 14px; font-weight: 500;">
                        请选择您的身份：&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <el-radio v-model="form.identity" label="tenant">租客</el-radio>
                        <el-radio v-model="form.identity" label="landlord">房东</el-radio>
                        <el-radio v-model="form.identity" label="admin">管理员</el-radio>
                    </div>
                </el-form-item>
                <el-form-item prop="username">
                    <el-input v-model="form.username" clearable prefix-icon="avatar" placeholder="用户名"></el-input>
                </el-form-item>
                <el-form-item prop="password">
                    <el-input v-model="form.password" clearable prefix-icon="lock" show-password placeholder="密码"></el-input>
                </el-form-item>
                <el-form-item prop="phone">
                    <el-input v-model="form.phone" clearable prefix-icon="phone" placeholder="电话号码"></el-input>
                </el-form-item>
                <el-form-item prop="email">
                    <el-input v-model="form.email" clearable prefix-icon="message" placeholder="邮箱"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button :disabled="!disabled" style="width: 30%; margin-left: auto; font-size: 15px;" type="primary" @click="register">注册/登录</el-button>
                </el-form-item>
            </el-form>
        </div>
    </div>
    <div class="footer">
        ©Copyright 2025 UPC, Edu.
    </div>
</template>
<script src="@/assets/js/Register.js"></script>
<style scoped>
.register-container {
    position: fixed;
    height: 100%;
    width: 100%;
    top: 0;
    left: 0;
    background: linear-gradient(
            135deg,
            hsl(170deg, 80%, 70%),
            hsl(190deg, 80%, 70%),
            hsl(250deg, 80%, 70%),
            hsl(320deg, 80%, 70%),
            hsl(320deg, 80%, 70%),
            hsl(250deg, 80%, 70%),
            hsl(190deg, 80%, 70%),
            hsl(190deg, 80%, 70%),
            hsl(170deg, 80%, 70%)
    );
    background-size: 600%;
    animation: animation 15s linear infinite;
}

@keyframes animation {
    0% {
        background-position: 0 0;
    }
    100% {
        background-position: 100% 100%;
    }
}

.footer {
    left: 0;
    bottom: 0;
    color: #fff;
    width: 100%;
    position: absolute;
    text-align: center;
    line-height: 30px;
    padding-bottom: 10px;
    text-shadow: #000 0.1em 0.1em 0.1em;
    font-size: 14px;
}

.footer a,
.footer span {
    color: #fff;
}
</style>